import { h } from 'vue';
import { NTag } from 'naive-ui';

export const columns = [
  {
    title: '城市名',
    key: 'cityName',
    width: 200,
  },
  {
    title: '城市简称',
    key: 'shortName',
  },
  {
    title: '行政区域编码',
    key: 'id',
  },
  {
    title: '级别',
    key: 'depth',
  },
  {
    title: '城市编码',
    key: 'cityCode',
  },
  {
    title: '邮政编码',
    key: 'zipCode',
  },
  {
    title: '全名称',
    key: 'mergerName',
  },
  {
    title: '经度',
    key: 'longitude',
  },
  {
    title: '纬度',
    key: 'latitude',
  },
  {
    title: '拼音',
    key: 'pinyin',
  },
  {
    title: '状态',
    key: 'deleted',
    render(row) {
      return h(
        NTag,
        {
          type: row.deleted === 0 ? 'success' : 'error',
        },
        {
          default: () => (row.deleted === 0 ? '启用' : '禁用'),
        }
      );
    },
  },
];
